﻿@model ICDA.Web.Models.AdminViewModel
@{
    ViewBag.Title = "LeaveAccount";
}
<div style="width: 100%; height: 30px; padding-bottom: 10px;">
    <div>
        <div style="font-size: 13px; font-weight: bold; float:left">
            Month:
        </div>
        <div style="font-size: 13px; float:left; margin-left:10px;">@Model.CurrentDateTime.ToString("y")
        </div>
    </div>
    <div>
        <table style="width: 70%; float: right;">
            <tr>
                <td style="font-size: 13px; font-weight: bold;">
                    Color Indications:
                </td>
                <td style="height: 10px; margin-top: 4px; float: left; width: 10px; margin-left: 10px;
                    background: #5E75E9">
                </td>
                <td>
                    Training Full Day
                </td>
                <td style="height: 10px; margin-top: 4px; width: 10px; float: left; margin-left: 10px;
                    background: #E9BD5E">
                </td>
                <td>
                    Training Half Day
                </td>
                <td style="height: 10px; margin-top: 4px; width: 10px; float: left; margin-left: 10px;
                    background: #E01B35">
                </td>
                <td>
                    Leave Full Day
                </td>
                <td style="height: 10px; margin-top: 4px; width: 10px; float: left; margin-left: 10px;
                    background: #6BBC4E">
                </td>
                <td>
                    Leave Half Day
                </td>
                <td style="height: 10px; width: 10px; margin-top: 4px; float: left; margin-left: 10px;
                    background: #E3E3E4">
                </td>
                <td>
                    None
                </td>
            </tr>
            <tr>
            </tr>
        </table>
    </div>
</div>
<div>
    <div style="width: 100%; font-size: 12px;">
        <div style="width: 50%; font-size: 12px; height: 50px; float: left;">
            @Html.ActionLink(" ", "LeaveByMonth", new { id = (Model.dtHelper.PreviousYearDate.ToString("MMM-yyyy")) }, new { @class = "previousLink" })
        </div>
        <div style="width: 50%; font-size: 12px; height: 50px; float: left;">
            @Html.ActionLink(" ", "LeaveByMonth", new { id = (Model.dtHelper.NextYearDate.ToString("MMM-yyyy")) }, new { @class = "nextLink" })
        </div>
    </div>
    <table style="width: 100%; font-size: 12px; border: 1px solid;" id="leaveUiTable"
        class="ui-widget">
        <thead class="ui-widget-header">
            <tr>
                <td>
                    <span class="table-header">Users</span>
                </td>
                @{
                    for (int i = 1; i <= Model.dtHelper.TotalDaysInMonth; i++)
                    {
                    <td>
                        <span class="table-header">@i</span>
                    </td>
                    }
                }
            </tr>
        </thead>
        <tbody class="ui-widget-content">
            @{
                foreach (KeyValuePair<string, List<string>> items in Model.LeaveLayout)
                {   
                <tr>
                    <td>
                        @items.Key
                    </td>
                    @{
                   foreach (var color in items.Value)
                   {
                       var td = "<td style='width:20px; height:28px; background:" + color + "'></td>";
                        @Html.Raw(td);
                   }
                    }
                </tr>

                }
            }
        </tbody>
    </table>
</div>
